<template>
  <div id="Incubation">
    <el-tabs
      :tab-position="tabPosition"
      :value="name"
      @tab-click="handleClick"
      style="height: 100%; width: 137px"
    >
      <el-tab-pane
        name="/home/Team/Teaminformation"
        label="团队信息"
      ></el-tab-pane>
      <el-tab-pane
        name="/home/Team/Team_Video_lectures"
        label="视频讲座"
      ></el-tab-pane>
      <el-tab-pane
        name="/home/Team/Team_Match_the_query"
        label="比赛查询"
      ></el-tab-pane>
      <el-tab-pane
        name="/home/Team/Team_Incubation_community"
        label="孵化社区"
      ></el-tab-pane>
      <el-tab-pane
        name="/home/Team/Team_Teacher_counsel"
        label="两创教师咨询"
      ></el-tab-pane>
      <el-tab-pane
        name="/home/Team/Team_Company_registry"
        label="公司注册"
      ></el-tab-pane>
      <el-tab-pane
        name="/home/Team/Team_Flea_market"
        label="跳蚤市场"
      ></el-tab-pane>
      <el-tab-pane
        name="/home/Team/Team_Create_new_team"
        label="新建团队"
      ></el-tab-pane>
    </el-tabs>
    <el-main class="Team_main">
      <router-view @name="replace"></router-view>
    </el-main>
  </div>
</template>

<script>
import Blog_details from "./Team_Incubation_community_Blog_details.vue";

export default {
  props: {},
  components: { Blog_details },
  data() {
    return {
      tabPosition: "left",
      name: "/home/Team/Teaminformation",
    };
  },
  methods: {
    handleClick(tab, event) {
      this.name = tab.name;
      this.$router.push(this.name);
      window.sessionStorage.setItem("Team_name", this.name);
    },
    replace(data) {
      console.log(1111);
      console.log(data);
      this.name = data;
    },
  },
  created() {
    if (window.sessionStorage.getItem("Team_name") != null) {
      this.name = window.sessionStorage.getItem("Team_name");
      this.$router.push(this.name);
    }
  },
  watch: {
    $route(to, from) {
      console.log(to);
      this.name = to.path;
    },
  },
};
</script>

<style lang="less">
#Incubation {
  // background-color: rgb(190, 25, 25);
  height: 100%;
  width: 100%;
  padding: 0px;
  margin: 0px;
  display: flex;

  // background-color: rgb(141, 23, 23);

  .el-tabs__item {
    height: 50px;
    //垂直居中
    line-height: 50px;
    // width: 120px;
    //水平剧中
    text-align: center;
  }
}

.Team_main {
  position: absolute;
  left: 130px;
  right: 0;
  top: 0;
  bottom: 0;
  overflow: hidden;
}
.Team_main::-webkit-scrollbar-thumb {
  border-radius: 3px;
  background: #fff;
}
.Team_main::-webkit-scrollbar {
  width: 6px;
}

.Team_main:hover::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
}
</style>